const mongoose = require("mongoose")

let admModel = mongoose.model("admModel")

// 获取门店
module.exports.getAdm = async function (){
    const data = await admModel.find()
    return data
}
module.exports.addAdm = async function (user) {
    return await admModel.create(user);
}
//updateAdm 修改管理员
module.exports.updateAdm = async function ({_id,username,password}) {
    return await admModel.updateOne({ _id }, {username,password});
}
//deleteAdm 删除管理员
module.exports.deleteAdm = async function (row) {
    return await admModel.deleteOne(row);
}
//denglu
module.exports.login = async function (user){
    const data = await admModel.find(user)
    return data
}